package mj.scott.back.question.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import mj.scott.back.base.response.JsonResult;
import mj.scott.back.question.pojo.dto.QuestionQuery;
import mj.scott.back.question.pojo.vo.QuestionVO;
import mj.scott.back.question.service.QuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("/v1/question/")
@Tag(name = "题目模块")
@Slf4j
public class QuestionController {
    @Autowired
    QuestionService questionService;
    /**
     * 查询题目
     */
    @GetMapping("select")
    @Operation(summary = "查询题目")
    @ApiOperationSupport(order = 10)
    public JsonResult selectQuestion(QuestionQuery query){
        log.debug("【控制器层】【查询题目】{}",query);
        List<QuestionVO> vo = questionService.select(query);
        return JsonResult.ok(vo);
    }
}
